


function mock(time) {
    let timer = null
    const task = () => {
        timer = setInterval(() => {
            console.log('timeout实现')
            clearInterval(timer)
            timer = null
        },time)
    }
    return task
}

const t = mock(1000)
t()
